<%--
  Created by IntelliJ IDEA.
  User: Wuzhiqi
  Date: 15-6-25
  Time: 下午4:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<head>
    <script src="/js/jquery.form.js" type="text/javascript"></script>
    <script src="/js/ajaxfileupload.js" type="text/javascript"
            ></script>
</head>
<div class="pageContent">
<form action="/manage/wallet/pluginCard/doUpdate"  method="post" onsubmit="return validateCallback(this , dialogAjaxDone);">
<div class="pageFormContent" layoutH="56">
<input type="hidden" name="id" value="${entity.id}"/>
<input type="hidden" name="sequence" value="${entity.sequence}"/>
<div class="divider"/>
<p>
    <label>归属类型:</label>
    <select id="belongingType" name="belongingType" style="width:180px">
        <c:forEach items="${belongingTypeEnum}" var="belongingType" varStatus="status">
            <option value="${belongingType.belongingTypeNO}" <c:if test="${belongingType.belongingTypeNO eq entity.belongingType.belongingTypeNO}">selected="selected" </c:if> >
                    ${belongingType.description}</option>
        </c:forEach>
    </select>
</p>
<p>
    <label>应用类型:</label>
    <select id="module" onchange="moduleSelect(this);" name="module"  style="width:180px">
        <c:forEach items="${moduleEnum}" var="module" varStatus="status">
            <option value="${module.moduleNO}" <c:if test="${module.moduleNO eq entity.module.moduleNO}"> selected="selected" </c:if> >${module.moduleName}</option>
        </c:forEach>
    </select>
</p>

<div id="commonSubModule">
    <p>
        <label>子模块:</label>
        <select id="subModule" name="subModule" style="width:180px">
            <c:forEach items="${subModuleEnum}" var="subModule" varStatus="status">
                <option value="${subModule.subModuleNO}" <c:if test="${subModule.subModuleNO eq entity.subModule.subModuleNO}"> selected="selected" </c:if> >${subModule.subModuleName}</option>
            </c:forEach>
        </select>
    </p>

    <p>
        <label style="color: #ff0000">标题栏子模块:</label>
        <select id="titleModule-subModule" name="titleModule.subModule" style="width:180px">
            <c:forEach items="${subModuleEnum}" var="subModule" varStatus="status">
                <option value="${subModule.subModuleNO}" <c:if test="${subModule.subModuleNO eq entity.titleModule.subModule.subModuleNO}"> selected="selected" </c:if>  >${subModule.subModuleName}</option>
            </c:forEach>
        </select>
    </p>
</div>

<p>
    <label>内容跳转选择:</label>
    <select id="selectContent1" onchange="selectContent(this);" style="width:180px">
        <option value="contentPlugin" <c:if test="${entity.module.moduleNO != null && entity.module.moduleNO != ''}"> selected="selected" </c:if>>应用代码</option>
        <option value="contentH5" <c:if test="${entity.contentURL != null && entity.contentURL != ''}"> selected="selected" </c:if>>H5链接</option>
    </select>

</p>

<p>
    <label style="color: #ff0000">标题栏跳转选择:</label>
    <select id="selectTitle1" onchange="selectTitle(this);" style="width:180px">
        <option value="titlePlugin" <c:if test="${entity.module.moduleNO != null && entity.module.moduleNO !=''}"> selected="selected" </c:if>>应用代码</option>
        <option value="titleH5" <c:if test="${entity.navigationUrl != null && entity.navigationUrl !=''}"> selected="selected" </c:if>>H5链接</option>
    </select>
</p>

<div id="divContentH5" style="display: none;">
    <p>
        <label>内容链接:</label>
        <input id="customContentURL" name="contentURL"　class="required" type="text" class="" maxlength="50" style="width:180px" value="${entity.contentURL}"/>
    </p>
</div>

<div id="divTitleH5" style="display: none;">
    <p class="nowrap">
        <label>标题栏导航链接:</label>
        <input id="navigationUrlTextarea" name="navigationUrl" class="required"　type="text" class="textInput valid" style="width:180px" value="${entity.navigationUrl}"/>
    </p>
</div>

<div id="WANGCAI" <c:if test="${entity.module.moduleNO ne 'WANGCAI'}"> style="display: none;" </c:if> >
    <p>
        <label style="color: #ff0000">标题栏品类代码:</label>
        <input id="titleModule-valueId"  <c:if test="${entity.module.moduleNO eq 'WANGCAI'}"> name="titleModule.valueId" </c:if>
               type="text" maxlength="50" class="required" style="width:180px" value="${entity.titleModule.valueId}"/>
    </p>
    <p>
        <label>品类代码:</label>
        <input id="valueId"  <c:if test="${entity.module.moduleNO eq 'WANGCAI'}"> name="valueId" </c:if>
               type="text" class="required" maxlength="50" style="width:180px" value="${entity.valueId}"/>
    </p>
    <p>
        <label>展示文案:</label>
        <input id="content"  <c:if test="${entity.module.moduleNO eq 'WANGCAI'}"> name="content" </c:if>
               type="text" maxlength="200" style="width:180px" value="${fn:substringBefore(entity.content, ",")}"/>
    </p>
    <p>
        <label>展示信息:</label>
        <select id="content"  <c:if test="${entity.module.moduleNO eq 'WANGCAI'}"> name="content" </c:if> style="width:180px">
            <option value="buyNum" <c:if test="${fn:endsWith(entity.content, 'buyNum')}"> selected="selected" </c:if> >申购人数</option>
            <option value="minimumBuyPrice" <c:if test="${fn:endsWith(entity.content, 'minimumBuyPrice')}"> selected="selected" </c:if> >起投金额</option>
        </select>
    </p>
</div>

<div id="INSURANCE" <c:if test="${entity.module.moduleNO ne 'INSURANCE'}"> style="display: none;" </c:if> >
    <p>
        <label style="color: #ff0000">标题栏保险id:</label>
        <input id="titleModule-valueId" <c:if test="${entity.module.moduleNO eq 'INSURANCE'}"> name="titleModule.valueId" </c:if>
               type="text" maxlength="50" class="required"　style="width:180px" value="${entity.titleModule.valueId}"/>
    </p>
    <p>
        <label>保险id:</label>
        <input id="valueId"  <c:if test="${entity.module.moduleNO eq 'INSURANCE'}"> name="valueId" </c:if>
               type="text" class="required" maxlength="50" style="width:180px" value="${entity.valueId}"/>
    </p>
    <p>
        <label>展示文案:</label>
        <input id="content" <c:if test="${entity.module.moduleNO eq 'INSURANCE'}"> name="content" </c:if>
               type="text" maxlength="200" style="width:180px" value="${entity.content}"/>
    </p>
</div>

<div id="STOCK" <c:if test="${entity.module.moduleNO ne 'STOCK'}"> style="display: none;" </c:if> >
    <p>
        <label>子模块:</label>
        <select id="subModule" style="width:180px">
            <c:forEach items="${stockSubModuleEnum}" var="stockSubModule" varStatus="status">
                <option value="${stockSubModule.subModuleNO}"<c:if
                        test="${stockSubModule.subModuleNO eq entity.subModule.subModuleNO}"> selected="selected" </c:if>>${stockSubModule.subModuleName}</option>
            </c:forEach>
        </select>
    </p>
    <p>
        <label style="color: #ff0000">标题栏子模块:</label>
        <select id="titleModule-subModule" name="titleModule.subModule" style="width:180px">
            <c:forEach items="${stockSubModuleEnum}" var="stockSubModule" varStatus="status">
                <option value="${stockSubModule.subModuleNO}"<c:if
                        test="${stockSubModule.subModuleNO eq entity.titleModule.subModule.subModuleNO}"> selected="selected" </c:if>>${stockSubModule.subModuleName}</option>
            </c:forEach>
        </select>
    </p>
    <p>
        <label style="color: #ff0000">标题栏收益冠军榜:</label>
        <select id="titleModule-valueId" style="width:180px" <c:if test="${entity.module.moduleNO eq 'STOCK'}"> name="titleModule.valueId" </c:if>>
            <option value="0" <c:if test="${entity.titleModule.valueId eq '0'}"> selected="selected" </c:if> >周冠军</option>
            <option value="1" <c:if test="${entity.titleModule.valueId eq '1'}"> selected="selected" </c:if> >月冠军</option>
            <option value="2" <c:if test="${entity.titleModule.valueId eq '2'}"> selected="selected" </c:if> >年冠军</option>
        </select>
    </p>
    <p>
        <label>收益冠军榜:</label>
        <select id="valueId" style="width:180px" <c:if test="${entity.module.moduleNO eq 'STOCK'}"> name="valueId" </c:if>>
            <option value="0" <c:if test="${entity.valueId eq '0'}"> selected="selected" </c:if> >周冠军</option>
            <option value="1" <c:if test="${entity.valueId eq '1'}"> selected="selected" </c:if> >月冠军</option>
            <option value="2" <c:if test="${entity.valueId eq '2'}"> selected="selected" </c:if> >年冠军</option>
        </select>
    </p>
    <p>
        <label>默认昵称:</label>
        <input id="content"  <c:if test="${entity.module.moduleNO eq 'STOCK'}"> name="content" </c:if>
               type="text" maxlength="200" style="width:180px" value="${fn:substringBefore(entity.content, ",")}"/>
    </p>
    <p>
        <input type="file" id="file3" name="file"/> <input class="uploadimg" type="button" value="默认头像上传"
                                                           onclick="ajaxFileUpload('file3', 'imgUrlId3', 'randimg3');"/>
    </p>

    <p class="nowrap">
        <img id="randimg3" src="${fn:substringAfter(entity.content, ",")}"  width="320" height="95"/>
    </p>

    <p class="nowrap">
        <label>默认头像链接:</label>
        <textarea id="imgUrlId3" type="text" class=" textInput valid" maxlength="200" cols="60" rows="2"
                <c:if test="${entity.module.moduleNO eq 'STOCK'}"> name="content" </c:if>>${fn:substringAfter(entity.content, ",")}</textarea>
    </p>
</div>

<div id="ROB" <c:if test="${entity.module.moduleNO ne 'ROB'}"> style="display: none;" </c:if> >
    <p>
        <label style="color: #ff0000">标题栏抢吧商品ID:</label>
        <input id="titleModule-valueId"  <c:if test="${entity.module.moduleNO eq 'ROB'}"> name="titleModule.valueId" </c:if>
               type="text"  maxlength="50" class="required"　style="width:180px" value="${entity.titleModule.valueId}"/>
    </p>

    <p>
        <label>推荐类型:</label>
        <select onchange="changeRobActivitySelect(this)" style="width:180px">
            <option value="0"  >自定义</option>
            <option value="1" <c:if test="${empty entity.valueId}"> selected="selected" </c:if> >自动</option>
        </select>
    </p>
    <p>
        <label>抢吧商品ID:</label>
        <input id="valueId"  <c:if test="${entity.module.moduleNO eq 'ROB'}"> name="valueId" </c:if>
                <c:choose>
                    <c:when test="${not empty entity.valueId}">
                        class="required"
                    </c:when>
                    <c:otherwise>
                        disabled="disabled" class="textInput"
                    </c:otherwise>
                </c:choose>
               type="text" class="required" maxlength="50" style="width:180px" value="${entity.valueId}"/>
    </p>
</div>

<div id="FUND" <c:if test="${entity.module.moduleNO ne 'FUND'}"> style="display: none;" </c:if> >
    <p>
        <label style="color: #ff0000">标题栏基金编码:</label>
        <input id="titleModule-valueId"  <c:if test="${entity.module.moduleNO eq 'FUND'}"> name="titleModule.valueId" </c:if>
               type="text" maxlength="50" class="required"　style="width:180px" value="${entity.titleModule.valueId}"/>
    </p>
    <p>
        <label>基金编码:</label>
        <input id="valueId"  <c:if test="${entity.module.moduleNO eq 'FUND'}"> name="valueId" </c:if>
               type="text" class="required" maxlength="50" style="width:180px" value="${entity.valueId}"/>
    </p>
    <p>
        <label>展示信息:</label>
        <select id="content"  <c:if test="${entity.module.moduleNO eq 'FUND'}"> name="content" </c:if> style="width:180px">
            <option value="0" <c:if test="${entity.content eq '0'}"> selected="selected" </c:if> >近1个月收益率</option>
            <option value="1" <c:if test="${entity.content eq '1'}"> selected="selected" </c:if> >近3个月收益率</option>
            <option value="2" <c:if test="${entity.content eq '2'}"> selected="selected" </c:if> >近半年收益率</option>
            <option value="3" <c:if test="${entity.content eq '3'}"> selected="selected" </c:if> >近一年收益率</option>
            <option value="4" <c:if test="${entity.content eq '4'}"> selected="selected" </c:if> >今年以来收益率</option>
        </select>
    </p>
</div>

<div id="CUSTOM" <c:if test="${entity.module.moduleNO ne 'CUSTOM'}"> style="display: none;" </c:if> >
</div>

<p>
    <label>描述:</label>
    <input name="description" type="text" class="textInput valid" maxlength="60"  style="width:180px"
           value="${entity.description}"/>
</p>

<p>
    <label>客户端类型:</label>
    <select id="clientName" name="clientName"  style="width:180px">
        <option value="android" <c:if test="${entity.clientName eq 'android'}"> selected="selected" </c:if> >android</option>
        <option value="iPhone" <c:if test="${entity.clientName eq 'iPhone'}"> selected="selected" </c:if> >iPhone</option>
    </select>
</p>
<!-- wuzhiqi 加功能，暂时不对运营开放 -->
<p>
    <label>支持客户端版本:</label>
    <input name="clientVersion" type="text" class="textInput valid" maxlength="60"  style="width:180px"
           value="${entity.clientVersion}"/>
</p>

<p>
    <label>状态：<c:if test="${entity.status eq '0'}">下线</c:if><c:if test="${entity.status eq '1'}">上线</c:if> </label>
    <input name="status" type="hidden" class="textInput valid" maxlength="60"  style="width:180px"
           value="${entity.status}"/>
</p>

<p>
    <label>状态切换定时:</label>
    <input type="text" name="statusSwitchTimer" class="date" readonly="true"
           datefmt="yyyy-MM-dd HH:mm:ss"
           value="<fmt:formatDate value="${entity.statusSwitchTimer}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
    <a class="inputDateButton" href="javascript:;">选择</a>
</p>

<p>
    <label>卡片标题:</label>
    <input name="title" type="text" class="required" maxlength="50" style="width:180px"
           value="${entity.title}"/>
</p>

<div id="titleImgSetting">
    <p>
        <input type="file" id="file1" name="file1"/> <input class="uploadimg" type="button" value="标题图片上传"
                                                            onclick="ajaxFileUpload('file1', 'imgUrlId1', 'randimg1');"/>
    </p>

    <p class="nowrap">
        <img id="randimg1" src=""  width="320" height="95"/>
    </p>

    <p class="nowrap">
        <label>标题图标链接:</label>
        <textarea id="imgUrlId1" name="imgUrl" type="text" class=" textInput valid" maxlength="200" cols="60" rows="2"
                ></textarea>
    </p>
</div>

<p>
    <label>副标题:</label>
    <input name="subtitle" type="text" class="" maxlength="50" style="width:180px"
           value="${entity.subtitle}"/>
</p>

<p>
    <label>标题背景色:</label>
    <input name="titleBgColor" type="text" maxlength="50" style="width:180px"
           value="${entity.titleBgColor}"/>(*注: RGB值)
</p>

<p>
    <label>标题栏导航文字:</label>
    <input name="navigationText" type="text" class="" maxlength="50" style="width:180px" value="${entity.navigationText}"/>
</p>

<p>
    <span style="color: red">!注意：默认屏幕高、宽、密度为1，其它按各自要求配置</span>
</p>
<p>
    <label>屏幕高度（像素）:</label>
    <input name="clientScreenConfigEntity.screenHeight" type="text"  maxlength="5" style="width:50px"
           value="${entity.clientScreenConfigEntity.screenHeight}" class="required digits"/>
</p>

<p>
    <label>屏幕宽度（像素）:</label>
    <input name="clientScreenConfigEntity.screenWidth" type="text" maxlength="5" style="width:50px"
           value="${entity.clientScreenConfigEntity.screenWidth}" class="required digits"/>
</p>

<p>
    <label>屏幕密度（PPI）:</label>
    <input name="clientScreenConfigEntity.screenDensity" type="text" maxlength="5" style="width:50px"
           value="${entity.clientScreenConfigEntity.screenDensity}" class="required digits"/>
</p>

<p>
    <label>是否显示角标:</label>
    <select id="showBadge" onchange="showAndHiddenBadge(this.value);" name="badgeConfigEntity.showBadge"
            style="width:180px">
        <option value="0" <c:if test="${entity.badgeConfigEntity.showBadge}">selected="selected" </c:if>>否</option>
        <option value="1" <c:if test="${entity.badgeConfigEntity.showBadge}">selected="selected" </c:if>>是</option>
    </select>
</p>
<div id="badgeSetting" <c:if test="${not entity.badgeConfigEntity.showBadge}"> style="display: none;" </c:if> >
    <!--
                <p>
                    <label>角标文字:</label>
                    <input name="badgeConfigEntity.badgeText" type="text" class="" maxlength="50" style="width:180px"
                           value="${entity.badgeConfigEntity.badgeText}"/>
                </p> -->
    <!--<label>角标文字颜色:</label> -->
    <!--
    <input name="badgeConfigEntity.badgeTextColor" type="hidden" class="" maxlength="50" style="width:180px"
           value="ffffff"/>
     -->
    <p>
        <label>角标背景颜色:</label>
        <select name="badgeConfigEntity.badgeColor"
                style="width:180px">
            <option value="e04c34" <c:if test="${entity.badgeConfigEntity.badgeColor eq 'e04c34'}">selected="selected" </c:if>>红</option>
        </select>
    </p>

    <p>
        <input type="file" id="file2" name="file"/> <input class="uploadimg" type="button" value="角标图片上传"
                                                           onclick="ajaxFileUpload('file2', 'imgUrlId2', 'randimg2');"/>
    </p>

    <p class="nowrap">
        <img id="randimg2" src=""  width="320" height="95"/>
    </p>

    <p class="nowrap">
        <label>角标图标链接:</label>
        <textarea id="imgUrlId2" name="badgeConfigEntity.badgeUrl" type="text" class=" textInput valid" maxlength="200" cols="60" rows="2"
                >${entity.badgeConfigEntity.badgeUrl}</textarea>
    </p>
</div>
<p>
    <label>是否需要登录：</label>
    <select name="needLogin" maxlength="50">
        <option value="0" <c:if test="${entity.needLogin eq '0'}">selected="selected"</c:if>>
            否
        </option>
        <option value="1" <c:if test="${entity.needLogin eq '1'}">selected="selected"</c:if>>
            是
        </option>
    </select>
</p>
<p>
    <label>是否需要实名：</label>
    <select name="needRealName" maxlength="50">
        <option value="0" <c:if test="${entity.needRealName eq '0'}">selected="selected"</c:if>>
            否
        </option>
        <option value="1" <c:if test="${entity.needRealName eq '1'}">selected="selected"</c:if>>
            是
        </option>
    </select>
</p>
<p>
    <label>是否支持外籍实名：</label>
    <select name="supportForeignRealName" maxlength="50">
        <option value="0" <c:if test="${entity.supportForeignRealName == false}">selected="selected"</c:if>>
            不支持
        </option>
        <option value="1" <c:if test="${entity.supportForeignRealName == true}">selected="selected"</c:if>>
            支持
        </option>
    </select>
</p>
</div>
<div class="formBar">
    <ul>
        <li>
            <div class="buttonActive">
                <div class="buttonContent">
                    <button type="submit">保存</button>
                </div>
            </div>
        </li>
        <li>
            <div class="button">
                <div class="buttonContent">
                    <button type="button" class="close">取消</button>
                </div>
            </div>
        </li>
    </ul>
</div>
</form>
</div>

